package com.bdqn.pojo;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;

/**
 * 用户
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("sys_user") // 当表名称和实体类名称对应时可以省略
public class User implements Serializable {

    @Serial
    private static final long serialVersionUID = 42L;

    @TableId(type = IdType.AUTO) // 用在主机上，自动生成ID主键
    @TableField("usr_id")
    private Long usrId;
    @TableField("usr_name") // MyBatis-Plus会自动将下划线方式的字段名映射到小驼峰属性
    private String usrName;
    private String usrPassword;
    private Long usrRoleId;
    private Integer usrFlag;

    public User(String usrName, String usrPassword, Long usrRoleId, Integer usrFlag) {
        this.usrName = usrName;
        this.usrPassword = usrPassword;
        this.usrRoleId = usrRoleId;
        this.usrFlag = usrFlag;
    }

}
